import { http } from '@/utils/http'
import { defineStore } from 'pinia'

export const useUserStore = defineStore(
	'user',
	() => {
		const userInfo = ref(null)

		const getUserInfo = async () => {
			let res: any = await http.get('/Usersd/my')
			if (res.code == 200) {
				userInfo.value = res.result
			}
		}

		return {
			userInfo,
			getUserInfo,
		}
	},
	{
		persist: true,
	},
)
